<template>
  <div class="body">
    <slot name="background" v-if="flag">
      <img class="My_background" src="http://liufusong.top:8080/img/profile/bg.png" alt="背景图">
    </slot>
    <slot name="background" v-else>
      <img class="My_background" src="http://liufusong.top:8080/img/avatar.png" alt="背景图">
    </slot>
  </div>
</template>

<script>

export default {
  name: 'MyPicture',

  props: {
    token: {
      type: [String, Object],
      required: true
    }
  },

  data () {
    return {
      flag: true
    }
  },
  created () {
    if (this.token) this.flag = !this.flag
  },
  methods: {}
}
</script>

<style scoped>
.My_background {
  width: 100%;
}
</style>
